package com.niguang.labour.admin.entity;

import java.io.Serializable;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.niguang.labour.admin.enums.PayWayEnum;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 'work.v_personSite' is not BASE TABLE
 * </p>
 *
 * @author
 * @since 2018-06-10
 */
@TableName("work_site_user")
@Data
public class WorkSiteUser extends Model<WorkSiteUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 企业ID
     */
    @TableField("qiye_id")
    private Long qiyeId;
    /**
     * 工地ID
     */
    @TableField("site_id")
    private Long siteId;
    /**
     * 订单编号
     */
    @TableField("sub_id")
    private Long subId;
    /**
     * 每日薪资
     */
    @TableField("day_salary")
    private String daySalary;
    /**
     * 是否是管理员 1--普通用户 2--工地管理员
     */
    @TableField("manage_type")
    private Integer manageType;
    /**
     * 数据来源 1--订单 2--手动添加
     */
    @TableField("source_type")
    private Integer sourceType;
    /**
     * 工种ID
     */
    @TableField("work_type_id")
    private Long workTypeId;
    /**
     * 创建人ID
     */
    @TableField("create_user_id")
    private Long createUserId;
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 是否删除 0-未删除 1-已删除
     */
    @TableField("del_flag")
    private Integer delFlag;
    /**
     * 劳务公司
     */
    @TableField("labor_company")
    private String laborCompany;
    /**
     * 劳务公司id
     */
    @TableField("labor_company_id")
    private Long laborCompanyId;

    /**
     * 班组 ID
     */
    @TableField("team_id")
    private Long teamId;

    /**
     * 计薪方式 1-点工 2-包工 3-月薪
     */
    @TableField("pay_way")
    private Integer payWay;

    /**
     * 月薪资
     */
    @TableField("month_salary")
    private Double monthSalary;

    /**
     * 起算时间（月薪）
     */
    @TableField("start_salary_date")
    private String startSalaryDate;

    /**
     * 安全信息
     */
    @TableField("safety_url")
    private String safetyUrl;

    /**
     * 劳务合同
     */
    @TableField("labor_url")
    private String laborUrl;

    // 添加班组长到工地员工列表
    public WorkSiteUser(Long userId, Long qiyeId, Long siteId, Integer manageType,
                        Long workTypeId, String laborCompany, Long laborCompanyId,
                        Long teamId, Double monthSalary, String startSalaryDate) {
        this.userId = userId;
        this.qiyeId = qiyeId;
        this.siteId = siteId;
        this.manageType = manageType;
        this.workTypeId = workTypeId;
        this.laborCompany = laborCompany;
        this.laborCompanyId = laborCompanyId;
        this.teamId = teamId;
        this.monthSalary = monthSalary;
        this.startSalaryDate = startSalaryDate;
        this.payWay = PayWayEnum.MONTH_WORK.getIndex();
    }

    public WorkSiteUser(Long createUserId) {
        this.createUserId = createUserId;
    }

    public WorkSiteUser() {
    }

    public static final String ID = "id";

    public static final String USER_ID = "user_id";

    public static final String QIYE_ID = "qiye_id";

    public static final String SITE_ID = "site_id";

    public static final String SUB_ID = "sub_id";

    public static final String DAY_SALARY = "day_salary";

    public static final String MANAGE_TYPE = "manage_type";

    public static final String SOURCE_TYPE = "source_type";

    public static final String WORK_TYPE_ID = "work_type_id";

    public static final String CREATE_USER_ID = "create_user_id";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String DEL_FLAG = "del_flag";

    public static final String LABOR_COMPANY = "labor_company";

    public static final String LABOR_COMPANY_ID = "labor_company_id";

    public static final String TEAM_ID = "team_id";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
